import requests
import json
import pandas as pd
key = "99b6fd576c6cb06dc071b44d30935237"

def geocode(address,key="99b6fd576c6cb06dc071b44d30935237",city=None,batch=None,sig=None,callback=None):
    """获取高德API的地理编码""" # 一定要写注释
    url = "https://restapi.amap.com/v3/geocode/geo?parameters"
    params = {
        "address":address,
        "key":key,
        "city":city,
        "batch":batch,
        "sig":sig,
        "callback":callback,
    }
    response = requests.get(url,params=params)
    results = response.json()
    return results

def around(location,types,key="99b6fd576c6cb06dc071b44d30935237"):
    """获取高德API的搜索POI——周边搜索"""
    around_url = "https://restapi.amap.com/v3/place/around"
    params = {
        "location":location,
        "types":types,
        "key":key,
    }
    r = requests.get(around_url,params=params)
    results = r.json()
    return results